#define _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    vector<int> twoSum(vector<int>& price, int target) {
        int left = 0, right = price.size() - 1;
        while (right != left)
        {
            if (price[right] + price[left] < target)
                left++;
            else if (price[right] + price[left] > target)
                right--;
            else
                return { price[right],price[left] };
        }
        return { -1,-1 };
    }
};